package com.project.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.EmployeeBean;
import com.project.bean.EmployeeDoProject;
import com.project.bean.LogUserBean;
import com.project.mapper.EmployeeBeanMapper;
import com.project.service.IEmployeeBeanService;
import com.project.service.ILogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeBeanServiceImpl implements IEmployeeBeanService {
    @Autowired
    private EmployeeBeanMapper mapper;
    @Override
    public void addEmp(EmployeeBean emp) {
        mapper.addEmp(emp);
    }

    @Override
    public void empLeave(int id) {
        mapper.empLeave(id);
    }

    @Override
    public void updateEmp(int id, String tel, Double money) {
        mapper.updateEmp(id, tel, money);
    }

    @Override
    public EmployeeBean findById(int id) {
        return mapper.findById(id);
    }

    @Override
    public PageInfo<EmployeeBean> findByItem(int pageNO, String name, String speciality, String state, String order) {
        PageHelper.startPage(pageNO, IEmployeeBeanService.PAGESIZE);
        PageInfo<EmployeeBean> pageInfo = PageInfo.of(mapper.findByItem(name,speciality,state,order));
        return pageInfo;
    }

    @Override
    public List<EmployeeBean> findNoInProject(int projectId, String name, String skill) {
        return mapper.findNoInProject(projectId, name, skill);
    }
}
